package com.juku2024.juku.model;

import android.os.Parcel;
import android.os.Parcelable;

public class EpisodesModel implements Parcelable {
    public String title;
    public String url;
    public boolean isPlaying;

    protected EpisodesModel(Parcel in) {
        title = in.readString();
        url = in.readString();
        isPlaying = in.readByte() != 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(title);
        dest.writeString(url);
        dest.writeByte((byte) (isPlaying ? 1 : 0));
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<EpisodesModel> CREATOR = new Creator<EpisodesModel>() {
        @Override
        public EpisodesModel createFromParcel(Parcel in) {
            return new EpisodesModel(in);
        }

        @Override
        public EpisodesModel[] newArray(int size) {
            return new EpisodesModel[size];
        }
    };
}
